<html><head><meta charset="utf-8"><title>10 接口的高阶用法-慕课专栏</title>
			<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
			<meta name="renderer" content="webkit">
			<meta property="qc:admins" content="77103107776157736375">
			<meta property="wb:webmaster" content="c4f857219bfae3cb">
			<meta http-equiv="Access-Control-Allow-Origin" content="*">
			<meta http-equiv="Cache-Control" content="no-transform ">
			<meta http-equiv="Cache-Control" content="no-siteapp">
			<link rel="apple-touch-icon" sizes="76x76" href="https://www.imooc.com/static/img/common/touch-icon-ipad.png">
			<link rel="apple-touch-icon" sizes="120x120" href="https://www.imooc.com/static/img/common/touch-icon-iphone-retina.png">
			<link rel="apple-touch-icon" sizes="152x152" href="https://www.imooc.com/static/img/common/touch-icon-ipad-retina.png">
			<link href="https://moco.imooc.com/captcha/style/captcha.min.css" rel="stylesheet">
			<link rel="stylesheet" href="https://www.imooc.com/static/moco/v1.0/dist/css/moco.min.css?t=201907021539" type="text/css">
			<link rel="stylesheet" href="https://www.imooc.com/static/lib/swiper/swiper-3.4.2.min.css?t=201907021539">
			<link rel="stylesheet" href="https://static.mukewang.com/static/css/??base.css,common/common-less.css?t=2.5,column/zhuanlanChapter-less.css?t=2.5,course/inc/course_tipoff-less.css?t=2.5?v=201907051055" type="text/css">
			<link charset="utf-8" rel="stylesheet" href="https://www.imooc.com/static/lib/ueditor/themes/imooc/css/ueditor.css?v=201907021539"><link rel="stylesheet" href="https://www.imooc.com/static/lib/baiduShare/api/css/share_style0_16.css?v=6aba13f0.css"></head>
			<body><div id="main">

<div class="container clearfix" id="top" style="display: block; width: 1134px;">
    
    <div class="center_con js-center_con l" style="width: 1134px;">
        <div class="article-con">
                            <!-- 买过的阅读 -->
                <div class="map">
                    <a href="/read" target="_blank"><i class="imv2-feather-o"></i></a>
                    <a href="/read/35" target="_blank">零基础学透 TypeScript</a>
                    <a href="" target="_blank">
                        <span>
                            / 2-7 10 接口的高阶用法
                        </span>
                    </a>
                </div>

            


            <div class="art-title" style="margin-top: 0px;">
                10 接口的高阶用法
            </div>
            <div class="art-info">
                
                <span>
                    更新时间：2019-07-01 14:22:49
                </span>
            </div>
            <div class="art-top">
                                <img src="https://img4.mukewang.com/5cf3c4c00001435206400359.jpg" alt="">
                                                <div class="famous-word-box">
                    <img src="https://www.imooc.com/static/img/column/bg-l.png" alt="" class="bg1 bg">
                    <img src="https://www.imooc.com/static/img/column/bg-r.png" alt="" class="bg2 bg">
                    <div class="famous-word">受苦的人，没有悲观的权利。<p class="author">——尼采</p></div>
                </div>
                            </div>
            <div class="art-content js-lookimg">
                <div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">学习了上个小节接口的基础用法后，相信你已经能够使用接口来描述一些结构了。本小节我们来继续学习接口，学习接口的高阶用法。接口有一小部分知识与类的知识相关，所以我们放在讲解类的小节后面补充讲解，我们先来学习除了这一小部分之外剩下的接口的知识。</p>
</div><div class="cl-preview-section"><h3 id="索引类型">2.7.1 索引类型</h3>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">我们可以使用接口描述索引的类型和通过索引得到的值的类型，比如一个数组<code>[‘a’, ‘b’]</code>，数字索引<code>0</code>对应的通过索引得到的值为<code>’a’</code>。我们可以同时给索引和值都设置类型，看下面的示例：</p>
</div><div class="cl-preview-section"><pre class="  language-typescript"><code class="prism  language-typescript"><span class="token keyword">interface</span> <span class="token class-name">RoleDic</span> <span class="token punctuation">{</span>
  <span class="token punctuation">[</span>id<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">]</span><span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">const</span> role1<span class="token punctuation">:</span> RoleDic <span class="token operator">=</span> <span class="token punctuation">{</span>
  <span class="token number">0</span><span class="token punctuation">:</span> <span class="token string">"super_admin"</span><span class="token punctuation">,</span>
  <span class="token number">1</span><span class="token punctuation">:</span> <span class="token string">"admin"</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> role2<span class="token punctuation">:</span> RoleDic <span class="token operator">=</span> <span class="token punctuation">{</span>
  s<span class="token punctuation">:</span> <span class="token string">"super_admin"</span><span class="token punctuation">,</span>  <span class="token comment">// error 不能将类型"{ s: string; a: string; }"分配给类型"RoleDic"。</span>
  a<span class="token punctuation">:</span> <span class="token string">"admin"</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> role3<span class="token punctuation">:</span> RoleDic <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">"super_admin"</span><span class="token punctuation">,</span> <span class="token string">"admin"</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
</code></pre>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">上面的例子中 role3 定义了一个数组，索引为数值类型，值为字符串类型。</p>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">你也可以给索引设置<code>readonly</code>，从而防止索引返回值被修改。</p>
</div><div class="cl-preview-section"><pre class="  language-typescript"><code class="prism  language-typescript"><span class="token keyword">interface</span> <span class="token class-name">RoleDic</span> <span class="token punctuation">{</span>
  readonly <span class="token punctuation">[</span>id<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">]</span><span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">const</span> role<span class="token punctuation">:</span> RoleDic <span class="token operator">=</span> <span class="token punctuation">{</span>
  <span class="token number">0</span><span class="token punctuation">:</span> <span class="token string">"super_admin"</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
role<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">"admin"</span><span class="token punctuation">;</span> <span class="token comment">// error 类型"RoleDic"中的索引签名仅允许读取</span>
</code></pre>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">这里有的点需要注意，你可以设置索引类型为 number。但是这样如果你将属性名设置为字符串类型，则会报错；但是如果你设置索引类型为字符串类型，那么即便你的属性名设置的是数值类型，也没问题。因为 JS 在访问属性值的时候，如果属性名是数值类型，会先将数值类型转为字符串，然后再去访问。你可以看下这个例子：</p>
</div><div class="cl-preview-section"><pre class="  language-javascript"><code class="prism  language-javascript"><span class="token keyword">const</span> obj <span class="token operator">=</span> <span class="token punctuation">{</span>
  <span class="token number">123</span><span class="token punctuation">:</span> <span class="token string">"a"</span><span class="token punctuation">,</span> <span class="token comment">// 这里定义一个数值类型的123这个属性</span>
  <span class="token string">"123"</span><span class="token punctuation">:</span> <span class="token string">"b"</span> <span class="token comment">// 这里在定义一个字符串类型的123这个属性，这里会报错：标识符“"123"”重复。</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>obj<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// { '123': 'b' }</span>
</code></pre>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">如果数值类型的属性名不会转为字符串类型，那么这里数值123和字符串123是不同的两个值，则最后对象obj应该同时有这两个属性；但是实际打印出来的obj只有一个属性，属性名为字符串"123"，而且值为"b"，说明数值类型属性名123被覆盖掉了，就是因为它被转为了字符串类型属性名"123"；又因为一个对象中多个相同属性名的属性，定义在后面的会覆盖前面的，所以结果就是obj只保留了后面定义的属性值。</p>
</div><div class="cl-preview-section"><h3 id="继承接口">2.7.2.继承接口</h3>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">接口可以继承，这和类(类的相关知识，我们会在后面全面详细的学习)一样，这提高了接口的可复用性。来看一个场景：</p>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">我们定义一个<code>Vegetables</code>接口，它会对<code>color</code>属性进行限制。再定义两个接口，一个为<code>Tomato</code>，一个为<code>Carrot</code>，这两个类都需要对<code>color</code>进行限制，而各自又有各自独有的属性限制，我们可以这样定义：</p>
</div><div class="cl-preview-section"><pre class="  language-typescript"><code class="prism  language-typescript"><span class="token keyword">interface</span> <span class="token class-name">Vegetables</span> <span class="token punctuation">{</span>
  color<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">interface</span> <span class="token class-name">Tomato</span> <span class="token punctuation">{</span>
  color<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
  radius<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">interface</span> <span class="token class-name">Carrot</span> <span class="token punctuation">{</span>
  color<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
  length<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">三个接口中都有对<code>color</code>的定义，但是这样写很繁琐，所以我们可以用继承来改写：</p>
</div><div class="cl-preview-section"><pre class="  language-typescript"><code class="prism  language-typescript"><span class="token keyword">interface</span> <span class="token class-name">Vegetables</span> <span class="token punctuation">{</span>
  color<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">interface</span> <span class="token class-name">Tomato</span> <span class="token keyword">extends</span> <span class="token class-name">Vegetables</span> <span class="token punctuation">{</span>
  radius<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">interface</span> <span class="token class-name">Carrot</span> <span class="token keyword">extends</span> <span class="token class-name">Vegetables</span> <span class="token punctuation">{</span>
  length<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">const</span> tomato<span class="token punctuation">:</span> Tomato <span class="token operator">=</span> <span class="token punctuation">{</span>
  radius<span class="token punctuation">:</span> <span class="token number">1.2</span> <span class="token comment">// error  Property 'color' is missing in type '{ radius: number; }'</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> carrot<span class="token punctuation">:</span> Carrot <span class="token operator">=</span> <span class="token punctuation">{</span>
  color<span class="token punctuation">:</span> <span class="token string">"orange"</span><span class="token punctuation">,</span>
  length<span class="token punctuation">:</span> <span class="token number">20</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
</code></pre>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">上面定义的 <code>tomato</code> 变量因为缺少了从<code>Vegetables</code>接口继承来的 <code>color</code> 属性，从而报错。</p>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">一个接口可以被多个接口继承，同样，一个接口也可以继承多个接口，多个接口用逗号隔开。比如我们再定义一个<code>Food</code>接口，<code>Tomato</code> 也可以继承 <code>Food</code>：</p>
</div><div class="cl-preview-section"><pre class="  language-typescript"><code class="prism  language-typescript"><span class="token keyword">interface</span> <span class="token class-name">Vegetables</span> <span class="token punctuation">{</span>
  color<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">interface</span> <span class="token class-name">Food</span> <span class="token punctuation">{</span>
  <span class="token keyword">type</span><span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">interface</span> <span class="token class-name">Tomato</span> <span class="token keyword">extends</span> <span class="token class-name">Food</span><span class="token punctuation">,</span> Vegetables <span class="token punctuation">{</span>
  radius<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token keyword">const</span> tomato<span class="token punctuation">:</span> Tomato <span class="token operator">=</span> <span class="token punctuation">{</span>
  <span class="token keyword">type</span><span class="token punctuation">:</span> <span class="token string">"vegetables"</span><span class="token punctuation">,</span>
  color<span class="token punctuation">:</span> <span class="token string">"red"</span><span class="token punctuation">,</span>
  radius<span class="token punctuation">:</span> <span class="token number">1.2</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>  <span class="token comment">// 在定义tomato变量时将继承过来的color和type属性同时声明</span>
</code></pre>
</div><div class="cl-preview-section"><h3 id="混合类型接口">2.7.3.混合类型接口</h3>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">JS 的类型是灵活的。在 JS 中，函数是对象类型。对象可以有属性，所以有时我们的一个对象，它既是一个函数，也包含一些属性。比如我们要实现一个计数器函数，比较直接的做法是定义一个函数和一个全局变量：</p>
</div><div class="cl-preview-section"><pre class="  language-javascript"><code class="prism  language-javascript"><span class="token keyword">let</span> count <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> <span class="token function-variable function">countUp</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> count<span class="token operator">++</span><span class="token punctuation">;</span>
</code></pre>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">但是这种方法需要在函数外面定义一个变量，更优一点的方法是使用闭包：</p>
</div><div class="cl-preview-section"><pre class="  language-javascript"><code class="prism  language-javascript"><span class="token comment">// javascript</span>
<span class="token keyword">const</span> countUp <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
  <span class="token keyword">let</span> count <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
  <span class="token keyword">return</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token operator">++</span>count<span class="token punctuation">;</span>
  <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token function">countUp</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// 1</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token function">countUp</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// 2</span>
</code></pre>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">在 TypeScript3.1 版本之前，我们需要借助命名空间来实现。但是在 3.1 版本，TypeScript 支持直接给函数添加属性，虽然这在 JS 中早就支持了：</p>
</div><div class="cl-preview-section"><pre class="  language-javascript"><code class="prism  language-javascript"><span class="token comment">// javascript</span>
<span class="token keyword">let</span> <span class="token function-variable function">countUp</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
  <span class="token keyword">return</span> <span class="token operator">++</span>countUp<span class="token punctuation">.</span>count<span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
countUp<span class="token punctuation">.</span>count <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token function">countUp</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// 1</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token function">countUp</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// 2</span>
</code></pre>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">我们可以看到，我们把一个函数赋值给<code>countUp</code>，又给它绑定了一个属性<code>count</code>，我们的计数保存在这个 <code>count</code> 属性中。</p>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">我们可以使用混合类型接口来指定上面例子中 <code>countUp</code> 的类型：</p>
</div><div class="cl-preview-section"><pre class="  language-typescript"><code class="prism  language-typescript"><span class="token keyword">interface</span> <span class="token class-name">Counter</span> <span class="token punctuation">{</span>
  <span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span> <span class="token comment">// 这里定义Counter这个结构必须包含一个函数，函数的要求是无参数，返回值为void，即无返回值</span>
  count<span class="token punctuation">:</span> <span class="token keyword">number</span><span class="token punctuation">;</span> <span class="token comment">// 而且这个结构还必须包含一个名为count、值的类型为number类型的属性</span>
<span class="token punctuation">}</span>
<span class="token keyword">const</span> getCounter <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> Counter <span class="token operator">=&gt;</span> <span class="token punctuation">{</span> <span class="token comment">// 这里定义一个函数用来返回这个计数器</span>
  <span class="token keyword">const</span> <span class="token function-variable function">c</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span> <span class="token comment">// 定义一个函数，逻辑和前面例子的一样</span>
    c<span class="token punctuation">.</span>count<span class="token operator">++</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span><span class="token punctuation">;</span>
  c<span class="token punctuation">.</span>count <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> <span class="token comment">// 再给这个函数添加一个count属性初始值为0</span>
  <span class="token keyword">return</span> c<span class="token punctuation">;</span> <span class="token comment">// 最后返回这个函数对象</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> counter<span class="token punctuation">:</span> Counter <span class="token operator">=</span> <span class="token function">getCounter</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// 通过getCounter函数得到这个计数器</span>
<span class="token function">counter</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>counter<span class="token punctuation">.</span>count<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// 1</span>
<span class="token function">counter</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>counter<span class="token punctuation">.</span>count<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">// 2</span>
</code></pre>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">上面的例子中，<code>getCounter</code>函数返回值类型为<code>Counter</code>，它是一个函数，无返回值，即返回值类型为<code>void</code>，它还包含一个属性<code>count</code>，属性返回值类型为<code>number</code>。</p>
</div><div class="cl-preview-section"><h2 id="小结" style="font-size: 30px;">小结</h2>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">本小节我们在接口基础知识的基础上，学习了接口的高阶用法。我们学习了如何限定索引的类型，即使用<code>[]</code>将索引名括起来，然后使用<code>: type</code>来指定索引的类型；还学习了一种复用现有接口的接口定义方式，即继承，使用<code>extends</code>关键字实现继承；最后我们通过计数器的例子，学习了如何使用混合类型接口实现更复杂的数据结构。还有一些涉及到类的关于接口的知识，我们会在讲了类之后做一个补充。</p>
</div><div class="cl-preview-section"><p style="font-size: 20px; line-height: 38px;">下个小节我们将学习函数的相关内容。函数是代码里的重头戏，而且内容较多，我们会分两个小节来讲解，跟紧别掉队哈。<img src="http://img.mukewang.com/5cf4bfe50001f4cf16000459.jpg" alt="图片描述" data-original="http://img.mukewang.com/5cf4bfe50001f4cf16000459.jpg" class="" style="cursor: pointer;"></p>
</div></div>
            </div>
                            <!-- 买过的阅读 -->
                <div class="art-next-prev clearfix">
                                                                        <!-- 已买且开放 或者可以试读 -->
                            <a href="/read/35/article/346">
                                                    <div class="prev l clearfix">
                                <div class="icon l">
                                    <i class="imv2-arrow3_l"></i>
                                </div>
                                <p>
                                    09 使用接口定义几乎任意结构
                                </p>
                            </div>
                        </a>
                                                                                            <!-- 已买且开放 或者可以试读 -->
                            <a href="/read/35/article/348">
                                                    <div class="next r clearfix">
                                <p>
                                    11 为函数和函数参数定义类型
                                </p>
                                <div class="icon r">
                                    <i class="imv2-arrow3_r"></i>
                                </div>

                            </div>
                        </a>
                                    </div>
                    </div>
        <div class="comments-con js-comments-con" id="coments_con">     <div class="number">精选留言 <span class="js-number">0</span></div>     <div class="comments">         <div class="input-fake js-showcommentModal">             欢迎在这里发表留言，作者筛选后可公开显示         </div>                      <div class="noData">                 <p>                     <i class="imv2-error_c"></i>                 </p>                 <p>目前暂无任何讨论</p>             </div>              </div>  </div>



    </div>
    
    
    

</div>
 
<!-- 专栏介绍页专栏评价 -->

<!-- 专栏介绍页底部三条评价 -->

<!-- 专栏阅读页弹层目录和介绍页页面目录 -->

<!-- 专栏阅读页发布回复 -->

<!-- 专栏阅读页发布评论 -->

<!-- 专栏阅读页底部评论 -->

<!-- 专栏阅读 单个 评论 -->

<!-- 新增回复和展开三条以外回复 -->

<!-- 立即订阅的弹窗 -->












</div></body></html>